package com.gaofans.vertx.boot.web.cors;

import io.vertx.core.http.HttpMethod;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * @author GaoFans
 */
public class CorsHandlerProperties {

    private Set<String> path = new LinkedHashSet<>();

    private String allowedOriginPattern = "*";

    private final Set<HttpMethod> allowedMethods = new LinkedHashSet();

    private final Set<String> allowedHeaders = new LinkedHashSet();

    private final Set<String> exposedHeaders = new LinkedHashSet();

    private boolean allowCredentials = false;

    private int maxAgeSeconds = 0;

    public Set<String> getPath() {
        return path;
    }

    public void setPath(Set<String> path) {
        this.path = path;
    }

    public String getAllowedOriginPattern() {
        return allowedOriginPattern;
    }

    public void setAllowedOriginPattern(String allowedOriginPattern) {
        this.allowedOriginPattern = allowedOriginPattern;
    }

    public Set<HttpMethod> getAllowedMethods() {
        return allowedMethods;
    }

    public Set<String> getAllowedHeaders() {
        return allowedHeaders;
    }

    public Set<String> getExposedHeaders() {
        return exposedHeaders;
    }

    public boolean isAllowCredentials() {
        return allowCredentials;
    }

    public void setAllowCredentials(boolean allowCredentials) {
        this.allowCredentials = allowCredentials;
    }

    public int getMaxAgeSeconds() {
        return maxAgeSeconds;
    }

    public void setMaxAgeSeconds(int maxAgeSeconds) {
        this.maxAgeSeconds = maxAgeSeconds;
    }
}
